home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12948 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: making an <include.h> file
  5. Date: 3 Apr 1996 17:06:57 GMT
  6. Organization: OpenVision
  7. Message-ID: <4jub7h$pal@spanky.pls.ov.com>
  8. References: <4js1iu$p1i@newsbf02.news.aol.com>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article p1i@newsbf02.news.aol.com, mjalford@aol.com (MJAlford) writes:
  13. >How does one setup a UNIX System / Makefile so that a "*.h" file is
  14. >considered
  15. >a system include file?  I don't want to put it in /usr/include.  I'm
  16. >assuming I do
  17. >the same thing so that my "library.so" is considered a system library.
  18. >
  19. >Thanks,
  20. >Michael Alford
  21. >Software Engineer
  22. >Accuvoice, Inc.
  23. >MJAlford@aol.com
  24.  
  25.  
  26. I'll bet that what you really want is a common place to keep your headers
  27. and library files.  When the cpp program is trying to resolve #include <header.h>
  28. it looks in /usr/include, and it also looks in any directory that is 
  29. listed with a -I option on the compile line.  For example:
  30. cc -I/my_include_dir -o myprog myprog.c
  31.  
  32. Similarly you can link in libraries in places other than /usr/lib using
  33. the -L option.  For example:
  34. cc -o myprog myprog.c -L/my_lib_dir -lmylib
  35.  
  36. On Sun platforms you might also want to use the -R (for runtime linking) of
  37. dynamic libraries.  See the cc, cpp, and ld man pages.
  38.  
  39.             Fletcher.Glenn@ov.com
  40.  
  41.  
  42.